<!-- 底部 -->
<template>
  <div class="bottom">
    <main>
      <div class="details">
        <h1>{{ i18n.bottom.contact }}</h1>
        <div>
          <p>
            <span>
              <i>
                <img src="@/assets/bottom/4.png" />
                {{ i18n.bottom.phone }}：{{ data.mobile }}
              </i>
              <i>
                <img src="@/assets/bottom/6.png" />
                {{ i18n.bottom.fax }}：{{ data.facsimile }}
              </i>
            </span>
            <span>
              <i>
                <img src="@/assets/bottom/5.png" />
                {{ i18n.bottom.hot }}： {{ data.mobile2 }}
              </i>
              <i>
                <img src="@/assets/bottom/7.png" />
                {{ i18n.bottom.site }}：{{ data.address }}
              </i>
            </span>
          </p>
          <span>
            <img :src="data.qrcode" />
            {{ i18n.bottom.scanall }}
          </span>
        </div>
      </div>
      <div class="share">
        <p>
          {{ data.address }}
          <span>
            <img @click="open(data.wb)" src="../assets/bottom/2.png" />
            <!-- <img src="../assets/bottom/3.png" /> -->
          </span>
        </p>
      </div>
    </main>
    <footer @click="open(data.copyright[0].value)">
      {{ i18n.bottom.copyright }}：{{ data.copyright[0].key }}
    </footer>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';
import bus from "@/config/emit";

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      data: {
        copyright: [{}],
      },
    };
  },
  //计算属性 类似于data概念
  computed: {
    i18n() {
      return this.$t("message");
    },
  },
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    open(url) {
      window.open(url, "_blank");
    },
    getcontact() {
      this.$getRequest("/index/contact").then((res) => {
        this.data = res.data;
      });
    },
  },
  beforeCreate() {}, //生命周期 - 创建之前
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {
    this.getcontact();
    bus.$on("lang", () => {
      this.getcontact();
    });
  },
  beforeMount() {}, //生命周期 - 挂载之前
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，激活
  deactivated() {}, //如果页面有keep-alive缓存功能，非激活
};
</script>
<style lang="less">
.bottom {
  width: 100%;

  & > footer {
    text-align: center;
    width: 100%;
    height: 1.1rem;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.2rem;
    color: #e5e5e5;
    cursor: pointer;
    cursor: hand;
  }

  & > main {
    width: 100%;
    height: 6.4625rem;
    background: url("../assets/bottom/1.png") no-repeat 50% 50%;
    background-size: 100% 100%;
    display: flex;
    flex-direction: column;

    & > .share {
      width: 100%;
      flex: 1;
      margin-top: 1.3rem;
      border-top: 1px solid #c4c4c4;

      & > p {
        width: 17.5rem;
        height: 100%;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 0.175rem;
        color: #595757;

        & > span {
          display: flex;

          & > img {
            width: 0.6375rem;
            margin: 0 0.1125rem;
          }
        }
      }
    }

    & > .details {
      width: 17.5rem;
      margin: 0 auto;
      padding-top: 1px;
      box-sizing: border-box;

      & > div {
        display: flex;
        align-items: center;
        justify-content: space-between;

        & > span {
          display: flex;
          align-items: center;
          flex-direction: column;
          font-size: 0.1625rem;
          color: #9e9e9e;

          & > img {
            width: 1.5375rem;
            padding: 0.0625rem;
            border-radius: 0.0625rem;
            background-color: #fff;
            margin-bottom: 0.4375rem;
            transition: all 0.3s;
          }

          & > img:hover {
            transform: scale(1.4);
          }
        }

        & > p {
          display: flex;
          font-size: 0.25rem;
          color: #fff;

          & > span {
            display: flex;
            flex-direction: column;
            margin-right: 1.375rem;

            & > i {
              display: flex;
              align-items: center;
              margin-bottom: 0.2875rem;

              & > img {
                width: 0.2rem;
                margin-right: 0.2rem;
              }
            }
          }
        }
      }

      & > h1 {
        font-size: 0.375rem;
        color: #fff;
        margin: 0.875rem 0 0.4125rem;
      }
    }
  }
}

@media screen and (max-width: 768px) {
  .bottom {
    & > footer {
      padding: 0 3rem;
      box-sizing: border-box;
      height: 4.4rem;
      font-size: 1.1rem;
    }

    & > main {
      height: 21.5rem;
      background: #222222;

      & > .share {
        width: 100%;
        flex: 1;
        margin-top: 1.3rem;

        & > p {
          width: 90%;
          font-size: 1.2rem;

          & > span {
            & > img {
              width: 3rem;
              margin: 0 1rem;
            }
          }
        }
      }

      & > .details {
        width: 90%;
        padding-top: 1px;
        box-sizing: border-box;

        & > div {
          & > span {
            font-size: 1rem;

            & > img {
              width: 8rem;
              padding: 0.5rem;
              border-radius: 0.5rem;
              margin-bottom: 0.5rem;
            }
          }

          & > p {
            flex: 1;
            font-size: 1.4rem;
            display: flex;
            flex-direction: column;

            & > span {
              display: flex;
              flex-direction: column;
              margin: 0;

              & > i {
                display: flex;
                align-items: center;
                margin: 0 0 1rem 0;

                & > img {
                  width: 1.4rem;
                  margin-right: 0.5rem;
                }
              }
            }
          }
        }

        & > h1 {
          font-size: 1.8rem;
          color: #fff;
          margin: 2rem 0 1rem;
        }
      }
    }
  }
}
</style>